import MyButton from './Button'
import MyInput from './Input'

const MyUI = {}

const COMPONENTS = [
    MyButton,
    MyInput
]

MyUI.install = function (Vue, options) {
    // 按需加载
   if (options && options.components) {
       const components = options.components
       components.forEach((componentName) => {
            COMPONENTS.forEach((component) => {
                if (componentName === component.name){
                    Vue.component(component.name, component)
                }
            })
       })
   } else {
       // 加载所有
       COMPONENTS.forEach((component) => {
        Vue.component(component.name, component)
       })
   }
}

export default MyUI;